function login() {
	console.log(1)
	uni.getUserProfile({
		desc: '用户小程序内部信息的展示',
		lang: 'zh_CN',
		success:(info) => {
			console.log(2)
			console.log(info)
			uni.login({
				provider: 'weixin',
				success:(res) => {
					console.log(3)
					console.log(res)
					uni.request({
						url: 'http://localhost:8985/schoolnews/schoolUser/login',
						method: 'GET',
						header: {"Content-Type": "application/x-www-form-urlencoded"},
						data: {
							code: res.code,
							gender:info.userInfo.gender,
							head_portrait: info.userInfo.avatarUrl,
							nickname: info.userInfo.nickName,
						},
						success:(data) => {
							token = data.data.data.token
							console.log(token)
						}
					})
				},
				fail(err) {
					console.log(err)
				}
			})
		}
	})
}
function getToken() {
	uni.getStorageSync({
		key: "login",
		success:(e) => {
			return e.data
		}
	})
}
export default {
	login,
	getToken
}
